package org.jeecg.modules.pacs.controller;

import org.jeecg.modules.pacs.entity.HealthCard;
import org.jeecg.modules.pacs.entity.ReportId;
import org.jeecg.modules.pacs.entity.ReportTable;
import org.jeecg.modules.pacs.service.FindPacsReportService;
import org.jeecg.modules.pacs.handle.Request;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(description = "pacs报告单查询")
@RequestMapping("/api/PACS")
public class PacsController {
    @Autowired
    FindPacsReportService findPacsReportService;

    @ApiOperation("根据身份证号和时间查询pacs报告单")
    @PostMapping("/getReportLis")
    public Request<List<ReportTable>> findReportTable(@RequestBody HealthCard healthCard) {
        return findPacsReportService.findPacsReportByIdcadrandTime(healthCard);
    }

    @ApiOperation("根据报告单号和类型查询pacs报告单")
    @PostMapping("/getReportDetail")
    public Request<ReportTable> findPacsReportTableList(@RequestBody ReportId reportId) {
        return findPacsReportService.findRepotrTableByReportIdAndType(reportId);
    }
    @ApiOperation("测试")
    @GetMapping("/getTest")
    public int getTest(int par) {
        Double i=Math.random()*par;
        return i.intValue();
    }

}
